package com.forward.uploadapp.entity;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;

import cn.bmob.v3.BmobObject;

/**
 * Created by ljh on 17-12-18.
 */

public class AppInfo extends BmobObject implements Serializable {
    private long taskId;
    private String appName;
    private String packageName;
    private String versionName;
    private String versionCode;
    private String downloadUrl;
    private String iconUrl;
    private String fileSize;
    private String describle;
    private String company;
    private String type;
    private String star;

    public AppInfo() {
    }

    public AppInfo(JSONObject obj) throws JSONException {
        taskId = obj.getInt("taskId");
        packageName = obj.getString("packageName");
        appName = obj.getString("appName");
        versionName = obj.getString("versionName");
        versionCode = obj.getString("versionCode");
        downloadUrl = obj.getString("downloadUrl");
        iconUrl = obj.getString("iconUrl");
        fileSize = obj.getString("fileSize");
        describle = obj.getString("describle");
        company = obj.getString("company");
        type = obj.getString("type");
        star = obj.getString("star");
    }

    public long getTaskId() {
        return taskId;
    }

    public void setTaskId(long taskId) {
        this.taskId = taskId;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public String getVersionName() {
        return versionName;
    }

    public void setVersionName(String versionName) {
        this.versionName = versionName;
    }

    public String getVersionCode() {
        return versionCode;
    }

    public void setVersionCode(String versionCode) {
        this.versionCode = versionCode;
    }

    public String getDownloadUrl() {
        return downloadUrl;
    }

    public void setDownloadUrl(String downloadUrl) {
        this.downloadUrl = downloadUrl;
    }

    public String getIconUrl() {
        return iconUrl;
    }

    public void setIconUrl(String iconUrl) {
        this.iconUrl = iconUrl;
    }

    public String getFileSize() {
        return fileSize;
    }

    public void setFileSize(String fileSize) {
        this.fileSize = fileSize;
    }

    public String getDescrible() {
        return describle;
    }

    public void setDescrible(String describle) {
        this.describle = describle;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getStar() {
        return star;
    }

    public void setStar(String star) {
        this.star = star;
    }

    @Override
    public String toString() {
        StringBuffer buffer = new StringBuffer();
        buffer.append("{");
        buffer.append("\"taskId\":\"").append(taskId).append("\",");
        buffer.append("\"appName\":\"").append(appName).append("\",");
        buffer.append("\"packageName\":\"").append(packageName).append("\",");
        buffer.append("\"versionName\":\"").append(versionName).append("\",");
        buffer.append("\"versionCode\":\"").append(versionCode).append("\",");
        buffer.append("\"downloadUrl\":\"").append(downloadUrl).append("\",");
        buffer.append("\"iconUrl\":\"").append(iconUrl).append("\",");
        buffer.append("\"fileSize\":\"").append(fileSize).append("\",");
        buffer.append("\"describle\":\"").append(describle).append("\",");
        buffer.append("\"company\":\"").append(company).append("\",");
        buffer.append("\"type\":\"").append(type).append("\",");
        buffer.append("\"star\":\"").append(star).append("\"");
        buffer.append("}");
        return buffer.toString();
    }
}